package charpter11.lynx;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Seven {

	private String name;
	
	public Seven(String name) {
		this.name = name;
	}
	
	public String toString(){
		return name;
	}
	
	public boolean equals(Object seven){
		return name.equals(seven.toString());
	}
	
	public static void main(String[] args){
		List<Seven> lists = new ArrayList<Seven>();
		for (int i = 0; i < 10; i++){
			lists.add(new Seven("" + i));
		}
		List<Seven> sub = lists.subList(1, 5);
		Iterator<Seven> iterator = sub.iterator();
		while (iterator.hasNext()) {
			iterator.next();
			iterator.remove();
			
		}
		System.out.println(lists);
	}
}
